﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_Assignment : System.Web.UI.Page
{
    rUser ruser = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["userid"] == null) { Response.Redirect("../Default.aspx"); }
        
        ruser = (rUser)(Session["userinfo"]);
        if (ruser != null)
        {
        }

        //Si es la primera vez que entra
        if (!Page.IsPostBack)
        {
            cb_msubmitted.SelectedIndex = 0;
        }
        else { ruser = (rUser)(Session["userinfo"]); }
    }
    protected void lnk_searchmul_Click(object sender, EventArgs e)
    {
        string ordersgroup = tb_orders.Text.Trim();

        ordersgroup = ordersgroup.Replace(",", "','");
        ordersgroup = "'" + ordersgroup + "'";
        ordersgroup = "and orden.ordernum in (" + ordersgroup + ")";
        if (!cb_msubmitted.SelectedValue.Equals("All"))
        {

            if (cb_msubmitted.SelectedValue.ToUpper().Equals("NO"))
            {
                ordersgroup = ordersgroup + " and (orden.ord_submit = 'NO' or orden.ord_submit is null )";
            }
            else
            {
                ordersgroup = ordersgroup + " and orden.ord_submit = 'YES'";
            }

        }
        Session["masivo"] = ordersgroup;
        Response.Redirect("MultipleSearch.aspx");
    }
}